package com.netty.server.cmd;

import cn.hutool.core.util.HexUtil;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

/**
 * 登录指令
 *
 * @author: 王霄
 * @date: 2022/1/19 18:05
 */
@Builder
@Data
public class LoginCmd implements Serializable {

    private ByteCmd origin;
    private String mac;

    public static LoginCmd deserialize(ByteCmd origin) {
        return LoginCmd.builder()
                .origin(origin)
                .mac(HexUtil.encodeHexStr(origin.getBody()))
                .build();
    }
}
